import http from "@/utils/request"

export default {
    /**
     * 删除商品信息
     * @param ids
     * @returns {Promise<axios.AxiosResponse<any>>}
     */
    deleteProductInfo(ids) {
        return http.delete(`/admin/product/info/delete/${ids}`)
    },

    /**
     * 修改商品信息
     * @param data
     * @returns {Promise<axios.AxiosResponse<any>>}
     */
    editProductInfo(data) {
        return http.put(`/admin/product/info/edit/`, data)
    },
    /**
     * 创建已上线的商品
     * @param data
     */
    createProductInfo(data) {
        return http.post('/admin/product/info/add', data)
    },
    getProductInfoPage(data) {
        return http.get('/admin/product/info/page', {params: data})
    },
    /**
     * 获取商品详细信息
     * @param id
     * @returns {Promise<axios.AxiosResponse<any>>}
     */
    getProductInfoDetail(id) {
        return http.get('/admin/product/info/detail/' + id)
    },
    passProduct(id) {
        return http.put('/admin/product/info/pass/' + id)
    },
    failProduct(id) {
        return http.put('/admin/product/info/fail/' + id)
    },
    downProduct(id) {
        return http.put('/admin/product/info/down/' + id)
    },
    addVoucher(data) {
        return http.post('/admin/product/voucher', data)
    },
    delVoucher(id) {
        return http.delete('/admin/product/voucher/' + id)
    },

}
